home *** CD-ROM | disk | FTP | other *** search
/ QRZ! Ham Radio 9 / QRZ Ham Radio Callsign Database - Volume 9.iso / mac / src / qrzdemo.frm < prev    next >
Text File  |  1996-06-24  |  8KB  |  303 lines

  1. VERSION 2.00
  2. Begin Form QRZDemo 
  3.    BackColor       =   &H00C0C0C0&
  4.    Caption         =   "QRZ Sample Application"
  5.    ClientHeight    =   3372
  6.    ClientLeft      =   792
  7.    ClientTop       =   1992
  8.    ClientWidth     =   6420
  9.    FillColor       =   &H00FFFFFF&
  10.    Height          =   4116
  11.    Left            =   744
  12.    LinkTopic       =   "QRZDemo"
  13.    ScaleHeight     =   3372
  14.    ScaleWidth      =   6420
  15.    Top             =   1296
  16.    Width           =   6516
  17.    Begin CommandButton Command7 
  18.       Caption         =   ">>"
  19.       Height          =   312
  20.       Left            =   2640
  21.       TabIndex        =   10
  22.       Top             =   1440
  23.       Width           =   672
  24.    End
  25.    Begin CommandButton Command6 
  26.       Caption         =   "<<"
  27.       Height          =   312
  28.       Left            =   300
  29.       TabIndex        =   9
  30.       Top             =   1440
  31.       Width           =   672
  32.    End
  33.    Begin CommandButton Command5 
  34.       Caption         =   "Continue"
  35.       Height          =   312
  36.       Left            =   4500
  37.       TabIndex        =   8
  38.       Top             =   2520
  39.       Width           =   1032
  40.    End
  41.    Begin CommandButton Command4 
  42.       Caption         =   "Count"
  43.       Height          =   312
  44.       Left            =   4440
  45.       TabIndex        =   7
  46.       Top             =   1440
  47.       Width           =   732
  48.    End
  49.    Begin CommandButton Command3 
  50.       Caption         =   "<"
  51.       Height          =   312
  52.       Left            =   1080
  53.       TabIndex        =   0
  54.       Top             =   1440
  55.       Width           =   672
  56.    End
  57.    Begin CommandButton Command2 
  58.       Caption         =   ">"
  59.       Height          =   312
  60.       Left            =   1860
  61.       TabIndex        =   5
  62.       Top             =   1440
  63.       Width           =   672
  64.    End
  65.    Begin CommandButton Command1 
  66.       Caption         =   "Search"
  67.       Default         =   -1  'True
  68.       Height          =   312
  69.       Left            =   3300
  70.       TabIndex        =   4
  71.       Top             =   2520
  72.       Width           =   1032
  73.    End
  74.    Begin TextBox Text2 
  75.       Height          =   288
  76.       Left            =   1860
  77.       TabIndex        =   2
  78.       Text            =   "a"
  79.       Top             =   2520
  80.       Width           =   1272
  81.    End
  82.    Begin TextBox Text1 
  83.       FontBold        =   -1  'True
  84.       FontItalic      =   0   'False
  85.       FontName        =   "Letter Gothic"
  86.       FontSize        =   9.6
  87.       FontStrikethru  =   0   'False
  88.       FontUnderline   =   0   'False
  89.       Height          =   1212
  90.       Left            =   120
  91.       MultiLine       =   -1  'True
  92.       TabIndex        =   1
  93.       Text            =   "To Begin, Click on the 'Search' button below."
  94.       Top             =   60
  95.       Width           =   6192
  96.    End
  97.    Begin Label Label5 
  98.       BackStyle       =   0  'Transparent
  99.       FontBold        =   -1  'True
  100.       FontItalic      =   0   'False
  101.       FontName        =   "MS Sans Serif"
  102.       FontSize        =   12
  103.       FontStrikethru  =   0   'False
  104.       FontUnderline   =   0   'False
  105.       Height          =   312
  106.       Left            =   2100
  107.       TabIndex        =   13
  108.       Top             =   2040
  109.       Width           =   4272
  110.    End
  111.    Begin Label Label4 
  112.       Alignment       =   2  'Center
  113.       BackStyle       =   0  'Transparent
  114.       FontBold        =   -1  'True
  115.       FontItalic      =   0   'False
  116.       FontName        =   "MS Sans Serif"
  117.       FontSize        =   18
  118.       FontStrikethru  =   0   'False
  119.       FontUnderline   =   0   'False
  120.       Height          =   432
  121.       Left            =   60
  122.       TabIndex        =   12
  123.       Top             =   1920
  124.       Width           =   2052
  125.    End
  126.    Begin Label Label3 
  127.       Alignment       =   2  'Center
  128.       BackStyle       =   0  'Transparent
  129.       Height          =   252
  130.       Left            =   120
  131.       TabIndex        =   11
  132.       Top             =   3000
  133.       Width           =   6192
  134.    End
  135.    Begin Label Label2 
  136.       Alignment       =   2  'Center
  137.       BackStyle       =   0  'Transparent
  138.       Caption         =   "0000"
  139.       Height          =   192
  140.       Left            =   5220
  141.       TabIndex        =   6
  142.       Top             =   1500
  143.       Width           =   732
  144.    End
  145.    Begin Label Label1 
  146.       Alignment       =   1  'Right Justify
  147.       BackStyle       =   0  'Transparent
  148.       Caption         =   "Callsign:"
  149.       Height          =   252
  150.       Left            =   840
  151.       TabIndex        =   3
  152.       Top             =   2580
  153.       Width           =   972
  154.    End
  155.    Begin Menu MenuExit 
  156.       Caption         =   "E&xit"
  157.    End
  158.    Begin Menu MenuAbout 
  159.       Caption         =   "&About..."
  160.    End
  161. End
  162. Option Explicit
  163.  
  164. Dim StopQRZ As Integer
  165. Dim Spinning As Integer
  166.  
  167. Sub Command1_Click ()
  168.     Dim tmp As String
  169.  
  170.     StopQRZ = True
  171.     Label3.Caption = ""
  172.     tmp = Text2.Text
  173.     ReturnLen = QRZSearch(QRZCALL, tmp, "", "", Found, DISP_FMT)
  174.     Label2.Caption = QRZGetCount()
  175.     DisplayRecord
  176.  
  177. End Sub
  178.  
  179. Sub Command2_Click ()
  180.  
  181.     ' Here we advance one record
  182.     ReturnLen = QRZAdvance(1, Found, DISP_FMT)
  183.     DisplayRecord
  184.  
  185. End Sub
  186.  
  187. Sub Command3_Click ()
  188.  
  189.     ' Back up one record
  190.     ReturnLen = QRZBack(1, Found, DISP_FMT)
  191.     DisplayRecord
  192.  
  193. End Sub
  194.  
  195. Sub Command4_Click ()
  196.  
  197.     Dim More As Integer
  198.     StopQRZ = True
  199.     Do
  200.         Label2.Caption = QRZCount(More)
  201.         DoEvents    ' to update screen
  202.  
  203.     Loop While More = True
  204.  
  205. End Sub
  206.  
  207. Sub Command5_Click ()
  208.  
  209.     StopQRZ = False
  210.     Label3.Caption = ""
  211.     Do
  212.         ReturnLen = QRZGetNext(Found, DISP_FMT)
  213.         If ReturnLen > 0 Then
  214.             DisplayRecord
  215.             Label2.Caption = QRZGetCount()
  216.         End If
  217.         DoEvents
  218.         If StopQRZ Then
  219.             Label3.Caption = "Stopped on user request."
  220.             Exit Do
  221.         End If
  222.  
  223.     Loop While ReturnLen > 0
  224.  
  225. End Sub
  226.  
  227. Sub Command6_Click ()
  228.     
  229.     'Back up 100 records - The number 100 below
  230.     'is only for illustration.  Any value > 1
  231.     'Backs up by 100
  232.     
  233.     ReturnLen = QRZBack(100, Found, DISP_FMT)
  234.     DisplayRecord
  235.  
  236. End Sub
  237.  
  238. Sub Command7_Click ()
  239.  
  240.     'Advance 100 records - The number 100 below
  241.     'is only for illustration.  Any value > 1
  242.     'advances by 100
  243.     ReturnLen = QRZAdvance(100, Found, DISP_FMT)
  244.     DisplayRecord
  245.  
  246. End Sub
  247.  
  248. Sub DisplayRecord ()
  249.     Dim tmp As String
  250.     Dim r As Integer
  251.  
  252.     If ReturnLen > 0 Then
  253.         Text1.Text = Left$(Found, ReturnLen)
  254.     End If
  255.     QRZField CALLS, Found, ReturnLen
  256.     If ReturnLen > 0 Then
  257.         Label4.Caption = Left$(Found, ReturnLen)
  258.     End If
  259.     QRZField FULLNAME, Found, ReturnLen
  260.     If ReturnLen > 0 Then
  261.         Label5.Caption = Left$(Found, ReturnLen)
  262.     End If
  263.     
  264. End Sub
  265.  
  266. Sub Form_Click ()
  267.     StopQRZ = True
  268. End Sub
  269.  
  270. Sub Form_Load ()
  271.     Dim drive As Integer
  272.     Dim tmp As String
  273.  
  274.     tmp = UCase$(Command$)
  275.     drive = QRZInit(tmp)
  276.  
  277.     If drive = -1 Then
  278.         MsgBox "QRZDLL is in use by another application.", 0, "QRZDEMO"
  279.         End
  280.     End If
  281.  
  282.     If drive = 0 Then
  283.         MsgBox "Error: The QRZ Databases could not be found.", 0, "QRZDEMO"
  284.     End If
  285.  
  286.     Label3.Caption = "Using QRZ CD in drive " & Chr$(drive) & ":"
  287.  
  288. End Sub
  289.  
  290. Sub MenuAbout_Click ()
  291.     MsgBox "This application is designed to show" & Chr$(10) & "how QRZDLL applications are built. " & Chr$(10) & "This program is not supported by QRZ." & Chr$(10) & "Feel free to modify and/or use whatever" & Chr$(10) & "parts of it that you find useful.", 64, "QRZDEMO Application"
  292. End Sub
  293.  
  294. Sub MenuExit_Click ()
  295.     Dim n%
  296.  
  297.     n = QRZExit()
  298.     ' uncomment the following to see the return value
  299.     'MsgBox "QRZExit returned " & n, 0, "QRZDEMO"
  300.     End
  301. End Sub
  302.  
  303.